import Cocoa
import FlutterMacOS

@main
class AppDelegate: FlutterAppDelegate {
  override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
    return true
  }

  override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
    return true
  }
  
  override func applicationDidFinishLaunching(_ notification: Notification) {
    // 注册 VPN 插件
    let controller = mainFlutterWindow?.contentViewController as! FlutterViewController
    VpnPlugin.register(with: controller.registrar(forPlugin: "VpnPlugin"))
  }
}
